package com.hq.fxh.Utils;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

/**
 * Created by {xue} on 2017/8/8.
 */

public class LogUtils {
    private  static boolean isOpenLog=true;
    private static Toast toast;

    public static void w(String message){
        if(isOpenLog){
            Log.w("<*******Log.w** ",message+"*************>");
        }
    }
    public static void e(String message){
        if(isOpenLog){
            Log.e("<*******Log.e** ",message+"*************>");
        }
    }
    public static void i(String message){
        if(isOpenLog){
            Log.i("<*******Log.i** ",message+"*************>");
        }
    }
    public static void d(String message){
        if(isOpenLog){
            Log.d("<*******Log.d** ",message+"*************>");
        }
    }

    public static void startToash(Context context, String string) {
        if (toast == null) {
            toast = Toast.makeText(context, string, Toast.LENGTH_SHORT);
            toast.show();

        } else {
            toast.setText(string);
            toast.setDuration(Toast.LENGTH_SHORT);
            toast.show();
        }
    }

}
